import Vue from 'vue'
import Router from 'vue-router'

import Index from '../components/Index'
import Home from "../components/home/Home";
import Login from "../components/loginRegister/Login";
import Register from "../components/loginRegister/Register";
import NewsList from "../components/newsNotice/NewsList";
import Activity from "../components/activity/Activity";
import BackSchool from "../components/services/BackSchool";
import OtherDonation from "../components/donations/OtherDonation";
import About from "../components/About";
import NoticeDetails from "../components/newsNotice/NoticeDetails";
import NoticeList from "../components/newsNotice/NoticeList";
import NewsDetails from "../components/newsNotice/NewsDetails";
import ActivityDetails from "../components/activity/ActivityDetails";
import CampusMap from "../components/services/CampusMap";
import DonationOnline from "../components/donations/DonationOnline";
import NotFound from "../components/404"
import PersonalCenter from "../components/personalCenter/PersonalCenter";
import MessageInfo from "../components/personalCenter/MessageInfo";
import AccountInfo from "../components/personalCenter/AccountInfo";
import PersonalInfo from "../components/personalCenter/PersonalInfo";
import SearchAlumni from "../components/services/SearchAlumni";
import AlumniInfo from "../components/AlumniInfo";

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/',
      name: 'index',
      component: Index,
      meta: {title: '首页'},
      redirect: '/home',
      children: [
        {
          path: '/home',
          name: 'home',
          component: Home,
          meta: {title: ''}
        },
        {
          path: '/newsList',
          name: 'newsList',
          component: NewsList,
          meta: {title: '校园新闻'},
        },
        {
          path: '/noticeList',
          name: 'noticeList',
          component: NoticeList,
          meta: {title: '通知公告'}
        },
        {
          path: '/noticeDetails',
          name: 'noticeDetails',
          component: NoticeDetails,
          meta: {title: '公告详情'}
        },
        {
          path: '/newsDetails',
          name: 'newsDetails',
          component: NewsDetails,
          meta: {title: '新闻详情'}
        },
        {
          path: '/activity',
          name: 'activity',
          component: Activity,
          meta: {title: '校友活动'}
        },
        {
          path: '/activityDetails',
          name: 'activityDetails',
          component: ActivityDetails,
          meta: {title: '活动详情'}
        },{
          path: '/backSchool',
          name: 'backSchool',
          component: BackSchool,
          meta: {title: '返校申请'}
        },
        {
          path: '/searchAlumni',
          name: 'searchAlumni',
          component: SearchAlumni,
          meta: {title: '校友查询'}
        },
        {
          path: '/campusMap',
          name: 'campusMap',
          component: CampusMap,
          meta: {title: '校园地图'}
        },
        {
          path: '/otherDonation',
          name: 'otherDonation',
          component: OtherDonation,
          meta: {title: '其他捐赠方式'}
        },
        {
          path: '/donationOnline',
          name: 'donationOnline',
          component: DonationOnline,
          meta: {title: '在线捐赠'}
        },{
          path: '/about',
          name: 'about',
          component: About,
          meta: {title: '关于我们'}
        }
      ]
    },
    {
      path: '/login',
      name: 'login',
      component: Login,
      meta: {title: '登录'}
    },
    {
      path: '/register',
      name: 'register',
      component: Register,
      meta: {title: '注册'}
    },
    {
      path: '/alumniInfo',
      name: 'alumniInfo',
      component: AlumniInfo,
      meta: {title: '校友基本信息'}
    },
    {
      path: '/personalCenter',
      redirect: '/messageInfo'
    },
    {
      path: '/personalCenter',
      name: 'personalCenter',
      component: PersonalCenter,
      meta: {title: '个人中心'},
      children: [
        {
          path: '/messageInfo',
          name: 'messageInfo',
          component: MessageInfo,
          meta: {title: '消息通知'}
        },
        {
          path: '/accountInfo',
          name: 'accountInfo',
          component: AccountInfo,
          meta: {title: '账号信息'}
        },
        {
          path: '/personalInfo',
          name: 'personalInfo',
          component: PersonalInfo,
          meta: {title: '个人信息'}
        }
      ]
    },
    {
      path: '*',
      name: 'notFound',
      component: NotFound,
      meta: {title: '找不到页面'}
    }
  ]
})
